gdk/wayland: Mark matched settings from the portal as valid
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 14 Jan 2021 14:47:36 +0000 (15:47 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 14 Jan 2021 14:57:29 +0000 (15:57 +0100)
Commit e6209de9625 added some checks on TranslationEntry.valid in
order to figure out whether using the new font settings or the
old g-s-d ones. However that's only set in the non-sandboxed case.

This makes sandboxed applications fallback to the old (and also
non-existing with modern g-s-d) settings, possibly resulting in
ugly defaults being picked.

Fix this by also marking TranslationEntry elements as valid when
using the settings portal, precisely those entries that we are able
to read and match with our own table.

gdk/wayland/gdkdisplay-wayland.c

index 39799e27627e1b318e6dfd5d4403d1aa6b04b9fc..f5ea972fa266e895e9e2031ffe6e93ae6c933678 100644 (file)
@@ -1836,6 +1836,7 @@ settings_portal_changed (GDBusProxy *proxy,
           char *a = g_variant_print (value, FALSE);
           g_debug ("Using changed portal setting %s %s: %s", namespace, name, a);
           g_free (a);
+          entry->valid = TRUE;
           apply_portal_setting (entry, value, display);
           gdk_display_setting_changed (display, entry->setting);
         }